<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\publics\model;

class TmplConfig extends \app\BaseModel
{
    protected $name = "longbing_card_tmpl_config";
    public function tmplSelect($dis)
    {
        $data = self::where($dis)->select()->toArray();
        return $data;
    }
    public function tmplUpdate($dis, $data)
    {
        $data["update_time"] = time();
        $res = self::where($dis)->update($data);
        return $res;
    }
    public function tmplAdd($data)
    {
        $data["create_time"] = time();
        $data["update_time"] = time();
        $res = self::insert($data);
        return $res;
    }
    public function tmplInfo($dis)
    {
        $data = self::where($dis)->find();
        if(empty($data)) {
            $data = $this->tmplAdd($dis);
            $data = self::where($dis)->find();
        }
        return !empty($data) ? $data->toArray() : $data;
    }
    public function tmplIdList($dis)
    {
        $data = $this->where($dis)->column("tmpl_id");
        return array_values($data);
    }
}

?>